//----------------------------------*-C++-*----------------------------------//
/*!
 * \file   GlobalSolver.hh
 * \author Jeremy Roberts
 * \date   11/23/2010
 * \brief  Base class for local problem routines.
 * \note   Copyright (C) 2010 Jeremy Roberts
 */
//---------------------------------------------------------------------------//
// $Rev:: 140                                           $:Rev of last commit
// $Author:: j.alyn.roberts@gmail.com                   $:Author of last commit
// $Date:: 2011-09-14 16:53:40 +0000 (Wed, 14 Sep 2011) $:Date of last commit
//---------------------------------------------------------------------------//

#ifndef GLOBALSOLVER_HH
#define GLOBALSOLVER_HH

#include <iostream>
#include <cmath>
#include "LinAlg.hh"
#include "GlobalInput.hh"
#include "ResponseFunctionServer.hh"
#include "ResponseMatrix.hh"
#include "ResponseMatrixFull.hh"
#include "AbsorptionResponse.hh"
#include "FissionResponse.hh"
#include "LeakageResponse.hh"
#include "ConnectMatrix.hh"
#include "Connect2dCart.hh"
#include "GlobalProblem.hh"

using namespace std;
//===========================================================================//
/*!
 * \class GlobalSolver
 * \brief This is a base class for all global solvers.
 *
 * The main function is to "solve" a global problem; this method must be 
 * implemented by each type of solver.  Methods found to be common will be
 * implemented here.  One example is the method to compute and print the
 * fission rates for a given incident current.
 *
 */
//===========================================================================//

class GlobalSolver
{

  public:

    GlobalSolver( GlobalProblem &pr, GlobalInput &in );
	~GlobalSolver();
    virtual void Solve() = 0;

  protected:
    GlobalProblem *problem;
    GlobalInput   *input;
    vector<scalar> keffHistory;
    vector<scalar> keffErrHistory;
    vector<scalar> curErrHistory;
    vector<scalar> residErrHistory;
    scalar wallTime;
	void fissionRates( SermentVector *J );

};

#endif // GLOBALSOLVER_HH

//---------------------------------------------------------------------------//
//                 end of GlobalSolver.hh
//---------------------------------------------------------------------------//

